<!DOCTYPE html>

<html lang="en" data-content_root="../../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>Scratch blocks → Pytch functions and methods &#8212; Pytch  documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
    <link rel="stylesheet" type="text/css" href="../../_static/classic.css?v=36340f97" />
    <link rel="stylesheet" type="text/css" href="../../_static/css/pytch-classic.css?v=0321735e" />
    
    <script src="../../_static/documentation_options.js?v=7f41d439"></script>
    <script src="../../_static/doctools.js?v=9bcbadda"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    
    <link rel="icon" href="../../_static/favicon.ico"/>
    <link rel="author" title="About these documents" href="../../about.html" />
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Functions in the pytch module" href="pytch-module-functions.html" />
    <link rel="prev" title="The stage" href="stage.html" /> 
  </head><body>
<div class="NavBar">
  <a href="../../../app/"><h1>Pytch</h1></a>
  <ul>
    <a href="https://pytch.scss.tcd.ie/"><li>About Pytch</li></a>
    <a href="../../index.html"><li>Help</li></a>
    <a href="../../../app/tutorials/"><li>Tutorials</li></a>
    <a href="../../../app/my-projects/"><li>My projects</li></a>
  </ul>
</div>
<div class="warning-work-in-progress">
  <p>These help pages are incomplete — we are working on it!</p>
</div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="scratch-blocks-pytch-functions-and-methods">
<h1>Scratch blocks → Pytch functions and methods<a class="headerlink" href="#scratch-blocks-pytch-functions-and-methods" title="Link to this heading">¶</a></h1>
<p>Apart from the <a class="reference internal" href="hat-blocks.html"><span class="doc">hat blocks</span></a>, which have <a class="reference internal" href="hat-blocks.html"><span class="doc">their
own help page</span></a>, Pytch provides equivalents to (some)
Scratch blocks in three ways:</p>
<section id="methods-on-a-sprite">
<h2>Methods on a Sprite<a class="headerlink" href="#methods-on-a-sprite" title="Link to this heading">¶</a></h2>
<p>Some Scratch blocks affect just the particular sprite they run on.
For example, the <em>switch costume</em> block.  For blocks like this, Pytch
uses <em>methods</em> of the Sprite class.  These are discussed in
<a class="reference internal" href="sprite.html"><span class="doc">their own help page</span></a>.</p>
</section>
<section id="methods-on-the-stage">
<h2>Methods on the Stage<a class="headerlink" href="#methods-on-the-stage" title="Link to this heading">¶</a></h2>
<p>Some Scratch blocks are special to the Stage.  For these blocks, Pytch
uses <em>methods</em> of the Stage class.  These are discussed in <a class="reference internal" href="stage.html"><span class="doc">their own
help page</span></a>.</p>
</section>
<section id="functions-in-the-pytch-module">
<h2>Functions in the pytch module<a class="headerlink" href="#functions-in-the-pytch-module" title="Link to this heading">¶</a></h2>
<p>Some Scratch blocks affect the whole project, for example <em>wait for 3
seconds</em>.  For these blocks, Pytch uses <em>functions</em> in the <code class="docutils literal notranslate"><span class="pre">pytch</span></code>
module.  These are discussed in <a class="reference internal" href="pytch-module-functions.html"><span class="doc">their own help page</span></a>.</p>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../webapp/user/index.html">Using the Pytch web app</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Writing Pytch programs</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="sprite.html">Sprites</a></li>
<li class="toctree-l2"><a class="reference internal" href="stage.html">The stage</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">Scratch blocks → Pytch functions and methods</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#methods-on-a-sprite">Methods on a Sprite</a></li>
<li class="toctree-l3"><a class="reference internal" href="#methods-on-the-stage">Methods on the Stage</a></li>
<li class="toctree-l3"><a class="reference internal" href="#functions-in-the-pytch-module">Functions in the pytch module</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="pytch-module-functions.html">Functions in the pytch module</a></li>
<li class="toctree-l2"><a class="reference internal" href="hat-blocks.html">Scratch hat blocks → Pytch decorators</a></li>
<li class="toctree-l2"><a class="reference internal" href="costume-specs.html">Defining costumes</a></li>
<li class="toctree-l2"><a class="reference internal" href="backdrop-specs.html">Defining backdrops</a></li>
<li class="toctree-l2"><a class="reference internal" href="sound-specs.html">Defining sounds</a></li>
<li class="toctree-l2"><a class="reference internal" href="multi-threading.html">Running many scripts at once</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../about.html">About Pytch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contact.html">Contact</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../developer.html">Developer documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../legal/index.html">Legal information</a></li>
</ul>
<div class="docs-home-link"><hr>
  <ul>
    <li>
      <a href="../../index.html">Pytch help home</a>
    <li>
  </ul>
</div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
  </body>
</html>